package com.zy.designpattern;

abstract public class Template {
    public final void getTime(){
        long start = System.currentTimeMillis();
        try {
            code();
        } catch (Exception e) {
            e.printStackTrace();
        }
        long end = System.currentTimeMillis();
        System.out.println("执行时间是："+(end - start));
    }
    public abstract void code() throws InterruptedException;

}
